using System;

namespace IValidate
{
	public abstract class ModelValidatorBaseImpl : System.Attribute, IModelValidator
	{
		public bool Required { get; private set; }
		public string ErrorMessage { get; private set; }

		public ModelValidatorBaseImpl(string errorMessage)
			: this(errorMessage, false)
		{
		}
		public ModelValidatorBaseImpl(string errorMessage, bool required)
		{
			Required = required;
			ErrorMessage = errorMessage;
		}
		public abstract bool Validate(object value);
	}
}
